import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralConferenceRoom = (params) => {
  params.head.transCode = 'queryGeneralConferenceRoom';
  return request({
    url: '/general/generalConferenceRoom/queryGeneralConferenceRoom',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralConferenceRoomListPage = (params) => {
  params.head.transCode = 'queryGeneralConferenceRoomListPage';
  return request({
    url: '/general/generalConferenceRoom/queryGeneralConferenceRoomListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralConferenceRoom = (params) => {
  params.head.transCode = 'saveGeneralConferenceRoom';
  return request({
    url: '/general/generalConferenceRoom/saveGeneralConferenceRoom',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralConferenceRoomList = (params) => {
  params.head.transCode = 'saveGeneralConferenceRoomList';
  return request({
    url: '/general/generalConferenceRoom/saveGeneralConferenceRoomList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralConferenceRoom = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralConferenceRoom';
  return request({
    url: '/general/generalConferenceRoom/saveOrUpdateGeneralConferenceRoom',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralConferenceRoomList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralConferenceRoomList';
  return request({
    url: '/general/generalConferenceRoom/saveOrUpdateGeneralConferenceRoomList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralConferenceRoom = (params) => {
  params.head.transCode = 'updateGeneralConferenceRoom';
  return request({
    url: '/general/generalConferenceRoom/updateGeneralConferenceRoom',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralConferenceRoom = (params) => {
  params.head.transCode = 'deleteGeneralConferenceRoom';
  return request({
    url: '/general/generalConferenceRoom/deleteGeneralConferenceRoom',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralConferenceRoomList = (params) => {
  params.head.transCode = 'deleteGeneralConferenceRoomList';
  return request({
    url: '/general/generalConferenceRoom/deleteGeneralConferenceRoomList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralConferenceRoomExcel = (params) => {
  downloadExcel({
    url: '/general/generalConferenceRoom/excelDownload/exportGeneralConferenceRoomExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
